Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simple pagetable setup in rust #27

Merged
merged 12 commits into from
Oct 16, 2023
Merged

Simple pagetable setup in rust #27

merged 12 commits into from
Oct 16, 2023

Conversation

gmacd
Copy link
Contributor

@gmacd gmacd commented Sep 16, 2023

This PR adds support for recursive pagetables in rust for aarch64.

l.S sets up the initial page tables in a rough, blunt way (e.g. larger than necessary pages just to get the kernel text mapped).

This code allows rust to set up a new set of pagetables, based on the physical memory map, DTB location, etc., and replaces the old pagetables. The new pagetables can then be modified to as necessary.

There are a number of things to do later, but best left for a future PR:

  • Deletion of pagetables
  • Possibly allocate early pagetables from the kernel heap
  • When manipulating the recursive entry in the page tables, invalidate the single entry rather than everything
  • Perhaps look at specifying the level as a table generic type (see https://github.com/dancrossnyc/rxv64/blob/main/kernel/src/vm.rs)
  • Fallback to smaller page size if the requested page size is too large

And for the far future:

  • Larger granule sizes than 4KiB
  • x86-64 and riscv64 versions

Signed-off-by: Graham MacDonald <[email protected]>
Signed-off-by: Graham MacDonald <[email protected]>
Signed-off-by: Graham MacDonald <[email protected]>
Signed-off-by: Graham MacDonald <[email protected]>
Signed-off-by: Graham MacDonald <[email protected]>
Signed-off-by: Graham MacDonald <[email protected]>
Signed-off-by: Graham MacDonald <[email protected]>
Signed-off-by: Graham MacDonald <[email protected]>
@orangecms
Copy link
Contributor

LGTM, to the best of my humble little knowledge

Signed-off-by: Graham MacDonald <[email protected]>
Signed-off-by: Graham MacDonald <[email protected]>
Signed-off-by: Graham MacDonald <[email protected]>
Signed-off-by: Graham MacDonald <[email protected]>
@gmacd gmacd merged commit 617e6bc into r9os:main Oct 16, 2023
4 checks passed
@gmacd gmacd deleted the 2023-09-09-pages branch October 16, 2023 19:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants